home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-19 / intrlib1.zip / INTR_GR.H < prev    next >
C/C++ Source or Header  |  1992-02-22  |  5KB  |  160 lines

  1. /******************************************************************************
  2. * MSDOS interaction library low level graphics routines.              *
  3. *                                          *
  4. *                    Written by Gershon Elber,  Oct. 1990  *
  5. *******************************************************************************
  6. * Supported device:                                  *
  7. * 1. CGA.                                      *
  8. * 2. EGA/VGA.                                      *
  9. * 3. Hercules.                                      *
  10. * 4. Super VGA.                                      *
  11. *******************************************************************************
  12. * History:                                      *
  13. *  15 Oct 90 - Version 1.0 by Gershon Elber.                      *
  14. ******************************************************************************/
  15.  
  16. #ifndef INTR_GR_H
  17. #define INTR_GR_H
  18.  
  19. #ifndef __MSDOS__
  20.  
  21. #define BLACK        0
  22. #define RED        4
  23. #define GREEN        2
  24. #define BLUE        1
  25. #define YELLOW        14
  26. #define CYAN        3
  27. #define MAGENTA        5
  28. #define WHITE        15
  29. #define MAX_COLOR    15
  30.  
  31. #endif /* __MSDOS__ */
  32.  
  33. #define GR_SOLID_FILL 1
  34.  
  35. typedef enum {        /* Line styles for Get/SetLineStyle. */
  36.     GR_SOLID_LINE  = 0,
  37.     GR_DOTTED_LINE = 1,
  38.     GR_DASHED_LINE = 3
  39. } GRLineStypeType;
  40.  
  41. typedef enum {        /* Line widths for Get/SetLineStyle. */
  42.     GR_NORM_WIDTH  = 1,
  43.     GR_THICK_WIDTH = 3
  44. } GRLineWidthType;
  45.  
  46. typedef enum {
  47.     GR_HORIZ_DIR = 0,    /* Left to right. */
  48.     GR_VERT_DIR  = 1    /* Bottom to top. */
  49. } GRTextDirType;
  50.  
  51. typedef enum {
  52.     GR_TEXT_HJUSTIFY_LEFT = 0,
  53.     GR_TEXT_HJUSTIFY_CENTER,
  54.     GR_TEXT_HJUSTIFY_RIGHT
  55. } GRTextHorizJustifyType;
  56.  
  57. typedef enum {
  58.     GR_TEXT_VJUSTIFY_BOTTOM = 0,
  59.     GR_TEXT_VJUSTIFY_CENTER,
  60.     GR_TEXT_VJUSTIFY_TOP
  61. } GRTextVertJustifyType;
  62.  
  63. typedef enum {
  64.     GR_FONT_DEFAULT = 0
  65. } GRFontType;
  66.  
  67. typedef enum {
  68.     GR_TEXT_MAG_1 = 1
  69. } GRTextmagnificationType;
  70.  
  71. typedef enum {
  72.     GR_COPY_PUT = 0,
  73.     GR_XOR_PUT = 1
  74. } GRWriteModeType;
  75.  
  76. extern int GRScreenMaxX, GRScreenMaxY;  /* The maximum resolution of screen. */
  77. extern int GRScreenMaxColors;          /* The maximum # of colors available. */
  78. extern IntrRType GRScreenAspect;/* Screen aspect ratio (pixel width/height). */
  79. extern int GRFontName, GRFontSize;     /* Global information on font used. */
  80. extern int GRCurrentCursorX, GRCurrentCursorY;   /* Cursor current position. */
  81. extern int GRDrawText;           /* If can not zoom down text, force draw. */
  82. extern int GRGraphMode, GRGraphDriver;        /* What driver/mode are we in. */
  83.  
  84. #if defined(__cplusplus) || defined(c_plusplus)
  85. extern "C" {
  86. #endif
  87.  
  88. #ifdef __MSDOS__
  89. void GRInstallSVGA(char *NameMode);
  90. void GRSetBGIPath(char *BGIPath);
  91. void GRSetDefaultDriver(int GraphDriver);
  92. unsigned GRGetImageBufferSize(int x1, int y1, int x2, int y2);
  93. void GRGetImageBuffer(int x1, int y1, int x2, int y2, VoidPtr Buffer);
  94. void GRPutImageBuffer(int x1, int y1, VoidPtr Buffer);
  95. #endif /* __MSDOS__ */
  96.  
  97. #ifdef DJGCC
  98. void *GRGetImageBuffer(int x1, int y1, int x2, int y2);
  99. void GRPutImageBuffer(int x1, int y1, void *Buffer);
  100. #endif /* DJGCC */
  101.  
  102. void GRInitGraph(void);
  103. void GRCloseGraph(void);
  104. void GRPutArrowCursor(int x, int y);
  105. void GRSetZoomFactor(int ZoomFactor);
  106. void GRSetPanFactors(int PanFactorX, int PanFactorY);
  107. void GRSetLineStyle(int LineStyle, unsigned int Pattern, int Thickness);
  108. void GRSetFillStyle(int Pattern, int Color);
  109. void GRSetWriteMode(int DrawMode);
  110. void GRSetTextJustify(int HorizCenter, int VertCenter);
  111. void GRSetTextStyle(int GRFontName, int Direction, int Size);
  112. void GRSetSTextStyle(int GRFontName, int Direction, int Size);
  113. void GRXORRectangle(int x1, int y1, int x2, int y2);
  114. int GRMapX(int x);
  115. int GRMapY(int y);
  116. int GRInvMapX(int x);
  117. int GRInvMapY(int y);
  118. void GRLine(int x1, int y1, int x2, int y2);
  119. void GRSLine(int x1, int y1, int x2, int y2);
  120. void GRMoveTo(int x, int y);
  121. void GRSMoveTo(int x, int y);
  122. void GRLineTo(int x, int y);
  123. void GRSLineTo(int x, int y);
  124. void GRMoveRel(int x, int y);
  125. void GRSMoveRel(int x, int y);
  126. void GRLineRel(int x, int y);
  127. void GRSLineRel(int x, int y);
  128. void GRPoly(int n, int *Points, int Fill);
  129. void GRBar(int x1, int y1, int x2, int y2);
  130. void GRSBar(int x1, int y1, int x2, int y2);
  131. void GRCircle(int x, int y, int r);
  132. void GRArc(int x, int y, int StAngle, int EndAngle, int r);
  133. IntrBType GRDrawingText(void);
  134. void GRText(int x, int y, char *s);
  135. void GRSText(int x, int y, char *s);
  136. void GRSTextShadow(int x, int y, int Color, char *s);
  137. int GRGetTextWidth(char *Str);
  138. int GRGetTextHeight(char *Str);
  139. void GRPushTextSetting(void);
  140. void GRPopTextSetting(void);
  141. void GRSetColor(int Color);
  142. int GRGetColor(void);
  143. void GRSetRGBPalette(int Index, int Red, int Green, int Blue);
  144. void GRClearViewPort(int x1, int y1, int x2, int y2);
  145. void GRGetViewPort(int *x1, int *y1, int *x2, int *y2);
  146. void GRSetViewPort(int x1, int y1, int x2, int y2);
  147. void GRPopViewPort(void);
  148. void GRPushViewPort(void);
  149. void GRClearAllScreen(void);
  150. void GRGetGraphicLine(int WindowID, int x, int y, char s[], int SLen,
  151.               int WindowLen, int ForeColor, int BackColor);
  152. void GRSetGetKeyFunc(IntrInt2PtrFunc GetChFunc);
  153. void GRTone(int Frequency, int Time);
  154.  
  155. #if defined(__cplusplus) || defined(c_plusplus)
  156. }
  157. #endif
  158.  
  159. #endif /* INTR_GR_H */
  160.